package com.example.demo.domain.exam;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.demo.annotation.Display;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.sql.Timestamp;

@Data
@RequiredArgsConstructor
@TableName(value = "exam_malpractice")
public class Malpractice {

    @Display("舞弊标识")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @Display("舞弊用户")
    @TableField(value = "user_id")
    private Long userId;

    @Display("提交题目")
    @TableField(value = "paper_id")
    private Long paperId;

    @Display("提交时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "create_time")
    private Timestamp createTime;

    @Display("得分")
    @TableField(value = "score")
    private Double score;

    @Display("时间差")
    @TableField(value = "time_difference")
    private Integer timeDifference;

    @TableField(exist = false)
    private String userName;

}
